<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>IM Message Handler</title>
<style type="text/css">@import url("../../../../org.eclipse.platform.doc.isv/book.css");</style>
<style type="text/css">@import url("../../../../org.eclipse.platform.doc.isv/schema.css");</style>
</HEAD>
<BODY>
<H1 style="text-align:center">IM Message Handler</H1>
<p></p>
<h6 class="CaptionFigColumn SchemaHeader">Identifier: </h6>org.eclipse.ecf.presence.bot.imMessageHandler<p></p>
<h6 class="CaptionFigColumn SchemaHeader">Since: </h6>1.0.0 milestone 6
<p></p>

<h6 class="CaptionFigColumn SchemaHeader">Description: </h6>This extension point allows message handler objects to be associated
with imrobot instances.<p></p>
<h6 class="CaptionFigColumn SchemaHeader">Configuration Markup:</h6>
<p></p>
<p class="code SchemaDtd">&lt;!ELEMENT <a name="e.extension">extension</a> (<a href="#e.handler">handler</a>+)&gt;</p>
<p class="code SchemaDtd">&lt;!ATTLIST extension</p>
<p class="code SchemaDtdAttlist">point&nbsp;CDATA #REQUIRED</p>
<p class="code SchemaDtdAttlist">id&nbsp;&nbsp;&nbsp;&nbsp;CDATA #IMPLIED</p>
<p class="code SchemaDtdAttlist">name&nbsp;&nbsp;CDATA #IMPLIED&gt;</p>
<p></p>
<ul class="ConfigMarkupAttlistDesc">
</ul>
<br><p class="code SchemaDtd">&lt;!ELEMENT <a name="e.handler">handler</a> EMPTY&gt;</p>
<p class="code SchemaDtd">&lt;!ATTLIST handler</p>
<p class="code SchemaDtdAttlist">imRobotId&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #REQUIRED</p>
<p class="code SchemaDtdAttlist">filterExpression&nbsp;CDATA #IMPLIED</p>
<p class="code SchemaDtdAttlist">class&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CDATA #REQUIRED&gt;</p>
<p></p>
<p class="ConfigMarkupElementDesc">
The im message handler</p>
<br>
<ul class="ConfigMarkupAttlistDesc">
<li><b>imRobotId</b> - Required imRobotId.  The value of this field must match a imrobot id</li>
<li><b>filterExpression</b> - Optional filter expression.  If filterExpression is provided, then chatroom messages will be filtered via given regular expression.  If match, then the handleChatRoomMessage method will be called.  If not matched, then the received message will be ignored.</li>
<li><b>class</b> - The class of the message handler instance to create.  Must implement <b>org.eclipse.ecf.presence.bot.IIMMessageHandler</b>.</li>
</ul>
<br><h6 class="CaptionFigColumn SchemaHeader">Examples: </h6><pre class="Example"><span class="code SchemaTag">
   &lt;extension
         point=</span><span class="code SchemaCstring">&quot;org.eclipse.ecf.presence.bot.imMessageHandler&quot;</span><span class="code SchemaTag">&gt;
      &lt;handler
            imrobotid=</span><span class="code SchemaCstring">&quot;org.eclipse.ecf.presence.imbot.defaultbot&quot;</span><span class="code SchemaTag">
            class=</span><span class="code SchemaCstring">&quot;org.eclipse.ecf.presence.imbot.DefaultIMMessageHandler&quot;</span><span class="code SchemaTag">&gt;
      &lt;/handler&gt;
   &lt;/extension&gt;
</span></pre>

Note that the given imrobotid=<b>org.eclipse.ecf.presence.imbot.defaultbot</b> must be previously defined via the imrobot extension point.  Here is an example:

<pre class="Example"><span class="code SchemaTag">
   &lt;extension
         point=</span><span class="code SchemaCstring">&quot;org.eclipse.ecf.presence.bot.imRobot&quot;</span><span class="code SchemaTag">&gt;
      &lt;imRobot
            connectID=</span><span class="code SchemaCstring">&quot;slewis@ecf.eclipse.org&quot;</span><span class="code SchemaTag">
            containerFactoryName=</span><span class="code SchemaCstring">&quot;ecf.xmpp.smack&quot;</span><span class="code SchemaTag">
            id=</span><span class="code SchemaCstring">&quot;org.eclipse.ecf.presence.imbot.defaultbot&quot;</span><span class="code SchemaTag">/&gt;
      &lt;/imRobot&gt;
   &lt;/extension&gt;
</span></pre>
<p></p>

<h6 class="CaptionFigColumn SchemaHeader">API Information: </h6>The class implementation provided in extension point must implement the following interface:

<pre class="Example"><span class="code SchemaTag">
public interface IIMMessageHandler extends IContainerAdvisor {

 /**
  * This method is called when a {@link IChatMessage} is received.
  * 
  * @param message
  *            the {@link IChatMessage} received. Will not be
  *            &lt;code&gt;null&lt;/code&gt;. Implementers should not block the
  *            calling thread. Any methods on the given &lt;code&gt;message&lt;/code&gt;
  *            parameter may be called.
  */
 public void handleIMMessage(IChatMessage message);

}
</span></pre>
<p></p>

<h6 class="CaptionFigColumn SchemaHeader">Supplied Implementation: </h6>No supplied implementation.
<p></p>

<br>
<p class="note SchemaCopyright">
Copyright (c) 2007 IBM Corporation and others.

This program and the accompanying materials are made
available under the terms of the Eclipse Public License 2.0
which is available at https://www.eclipse.org/legal/epl-2.0/

SPDX-License-Identifier: EPL-2.0

</p>
</BODY>
</HTML>
